package com.yym.test.sort;

/**
 * Created by StickT on 2017/4/14.
 */
public class BubbleSort {

    public static void main(String[] args) {
        int[] a = {12,45,854,784,454,45,75,84,654,85};
        int n = a.length;
        for (int i = 0;i < n-1;i++){
            for (int j = 0;j< n-1-i;j++){
                if(a[j]<a[j+1]){
                    int temp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = temp;
                }
            }
        }

        for (int i=0;i<=n-1;i++){
            System.out.println(a[i]);
        }

    }
}
